package HP.Demo;

import java.util.Scanner;

public class Gou_Wu {
    public static void main(String[] args) {
        String s1 = "T恤";
        double p1 = 245;
        int n1 = 2;

        String s2 = "网球鞋";
        double p2 = 570;
        int n2 = 1;

        String s3 = "网球拍";
        double p3 = 320;
        int n3 = 1;


        System.out.println("******消费单******");
        System.out.println("购买物品\t单价\t个数\t金额");
        System.out.println(s1+"\t\t\t"+"¥"+p1+"\t"+n1+"\t\t"+"¥"+p1*n1);
        System.out.println(s2+"\t\t"+"¥"+p2+"\t"+n2+"\t\t"+"¥"+p2*n2);
        System.out.println(s3+"\t\t"+"¥"+p3+"\t"+n3+"\t\t"+"¥"+p3*n3);

        System.out.print("请输入折扣:");
        Scanner discout = new Scanner(System.in);
        int dis = discout.nextInt();
        System.out.println("折扣:           " + dis+"折");
        System.out.println("消费总金额:     ¥"+(p1*n1+p2*n2+p3*n3)*(dis*0.1));
        System.out.println("请输入实际交费: ");
        Scanner money = new Scanner(System.in);
        double mon = money.nextDouble();

        if(mon<((p1*n1+p2*n2+p3*n3)*(dis*0.1))){
            System.out.println("您的交费不足以支付!");
        }else {
            System.out.println("实际交费:      ¥"+mon);
            System.out.println("找零:          ¥"+(mon-((p1*n1+p2*n2+p3*n3)*(dis*0.1))));
            System.out.println("本次购物所获积分:"+(int)((p1*n1+p2*n2+p3*n3)*(dis*0.1)*0.03));
        }
    }
}
